import request from '@/utils/request'

/**
 * 获取地址列表
 */
export function getAddressList() {
  return request.get('/address/list')
}

/**
 * 获取地址详情
 */
export function getAddressDetail(id) {
  return request.get(`/address/${id}`)
}

/**
 * 保存地址（新增或编辑）
 */
export function saveAddress(data) {
  return request.post('/address/save', data)
}

/**
 * 删除地址
 */
export function deleteAddress(id) {
  return request.post(`/address/delete/${id}`)
}

/**
 * 设置默认地址
 */
export function setDefaultAddress(id) {
  return request.post(`/address/setDefault/${id}`)
}
